<?php

namespace app\home\controller;

use app\home\controller\Common;
use function PHPSTORM_META\elementType;
use think\Db;
use think\facade\Env;

class Map extends Common
{
    public function index()
    {
        $info = db('area')->where('id=1')->find();
        $area = json_decode($info['area'],true);
        $GZData = [];   //线图
        $select = [];   //高亮城市
        foreach ($area as $key=>$value){
            if ($key!=$info['city']||!empty($value)){
                $arr = [['name'=>$info['city']],['name'=>$key]];
                array_push($GZData,$arr);
            }
            $sel = ['name'=>$key,'selected'=>1];
            array_push($select,$sel);
        }
        $this->assign('area',$area);
        $this->assign('GZData',$GZData);
        $this->assign('select',$select);
        $this->assign('title',$info['title']);

        return view();
    }
}
